/*
 * @Author: 137 '1432417996@qq.com'
 * @Date: 2025-03-24 21:09:09
 * @LastEditors: 137 '1432417996@qq.com'
 * @LastEditTime: 2025-04-14 17:44:27
 * @FilePath: \starter-3\components\utils\axios.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from 'axios';
const service = axios.create({
  timeout: 40000,
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json; charset=UTF-8'
  },
})
service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    Promise.reject(error)
  }
)

// response interceptor
service.interceptors.response.use(
  response => {
    const res = response.data;
    return res
  },
  error => {
      console.log(error)
  }
)
export default service
